package com.zhangzhan.gulimallorder.web;

import com.alipay.api.AlipayApiException;
import com.zhangzhan.gulimallorder.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 张一恒
 * @version 1.0
 * @description:
 * @date 2024/7/3 16:20
 */
@Controller
public class AliPayController {

    @Autowired
    private OrderService orderService;


    @ResponseBody
    @RequestMapping(value = "alipay", method = RequestMethod.GET,produces = "text/html")
    public String alipay(@RequestParam("orderSn") String orderSn) throws AlipayApiException {
        String alipayHtml = orderService.alipay(orderSn);

        return alipayHtml;
    }

}
